package com.baizhi.cmfzdemo.controller;

import com.baizhi.cmfzdemo.entity.CmfzArticle;
import com.baizhi.cmfzdemo.entity.CmfzAudio;
import com.baizhi.cmfzdemo.service.CmfzArticleService;
import com.baizhi.cmfzdemo.service.CmfzAudioService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * Created by 54433 on 2019/4/4.
 */
@Controller
@RequestMapping("/CmfzAudio")
public class CmfzAudioController {
    @Autowired
    private CmfzAudioService cmfzAudioService;

    //展示所有
    @RequestMapping("/queryAllCmfzAudio")
    @ResponseBody
    public Map queryAllCmfzAudio(int page,int rows){
        System.out.println(cmfzAudioService.queryAllCmfzAudio(page,rows));
        return cmfzAudioService.queryAllCmfzAudio(page,rows);
    }
    @RequestMapping("/deleteCmfzAudio")
    @ResponseBody
    public Map deleteCmfzAudio(int [] ids){
        return cmfzAudioService.deleteCmfzAudio(ids);
    }
    @RequestMapping("/insertCmfzAlbum")
    @ResponseBody
    public Map insertCmfzAudio(CmfzAudio cmfzAudio){
        return cmfzAudioService.addCmfzAudio(cmfzAudio);
    }
    @RequestMapping("/updateCmfzArticle")
    @ResponseBody
    public Map updateCmfzAudio(CmfzAudio cmfzAudio){
        return cmfzAudioService.updateCmfzAudio(cmfzAudio);
    }
}
